<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 验证码接口
 * @author tfcn
 *
 */
class Captcha extends MY_Controller {
	public function generate(){
		$this->load->helper('captcha');
		$this->load->helper('string');
		$img_path = $this->config->item('file_path').'captcha/';
		
		$captcha = array(
				'word' => random_string('alpha',4),
				'img_path' => $img_path,
				'img_url' => site_url().$img_path,
				'img_width' => '150',
				'img_height' => 30,
				'expiration' => 7200				
				);
		$cap = create_captcha($captcha);
		var_dump($cap);
		//echo $cap['image'];
		//phpinfo();
	}
}